package cn.gson.fengboot.model.pojos;

import javax.persistence.*;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;
import java.util.Objects;

@Entity
public class Zreturnedgood {
    private Integer returgoodId;//退货ID
    private Zorder orderId;//订单
    private TfyclientForm clientId;//客户
    private Zchuku chukuId;
    private String returgoodNo;//退货单号
    private Timestamp returgoodWctime;//退货时间
    private Timestamp returgoodTime;//退货时间
    private BigDecimal returgoodYreimburse;//退货应退款
    private BigDecimal returgoodReimburse;//退货已退款
    private String returgoodWarehouse;//退货退入仓库
    private String returgoodState;//退货状态
    private String returgoodRemark;//备注
    private String returgoodPass;//退货审核是否通过
    private String returgoodPeople;//退货负责员工
    private Integer returgoodZt;//状态
    private String returgoodTheme;//主题
    private List<Zreturnedgooddetail> thxq;


    @Id
    @Column(name = "returgood_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Integer getReturgoodId() {
        return returgoodId;
    }

    public void setReturgoodId(Integer returgoodId) {
        this.returgoodId = returgoodId;
    }

    @ManyToOne
    @JoinColumn(name = "order_id", referencedColumnName = "order_id")
    public Zorder getOrderId() {
        return orderId;
    }

    public void setOrderId(Zorder orderId) {
        this.orderId = orderId;
    }

    @ManyToOne
    @JoinColumn(name = "chuku_id", referencedColumnName = "chuku_id")
    public Zchuku getChukuId() {
        return chukuId;
    }

    public void setChukuId(Zchuku chukuId) {
        this.chukuId = chukuId;
    }

    @ManyToOne
    @JoinColumn(name = "client_id", referencedColumnName = "client_id")
    public TfyclientForm getClientId() {
        return clientId;
    }

    public void setClientId(TfyclientForm clientId) {
        this.clientId = clientId;
    }

    @Basic
    @Column(name = "returgood_wctime")
    public Timestamp getReturgoodWctime() {
        return returgoodWctime;
    }

    public void setReturgoodWctime(Timestamp returgoodWctime) {
        this.returgoodWctime = returgoodWctime;
    }

    @Basic
    @Column(name = "returgood_zt")
    public Integer getReturgoodZt() {
        return returgoodZt;
    }

    public void setReturgoodZt(Integer returgoodZt) {
        this.returgoodZt = returgoodZt;
    }

    @Basic
    @Column(name = "returgood_theme")
    public String getReturgoodTheme() {
        return returgoodTheme;
    }

    public void setReturgoodTheme(String returgoodTheme) {
        this.returgoodTheme = returgoodTheme;
    }

    @Basic
    @Column(name = "returgood_no")
    public String getReturgoodNo() {
        return returgoodNo;
    }

    public void setReturgoodNo(String returgoodNo) {
        this.returgoodNo = returgoodNo;
    }

    @Basic
    @Column(name = "returgood_time")
    public Timestamp getReturgoodTime() {
        return returgoodTime;
    }

    public void setReturgoodTime(Timestamp returgoodTime) {
        this.returgoodTime = returgoodTime;
    }

    @Basic
    @Column(name = "returgood_yreimburse")
    public BigDecimal getReturgoodYreimburse() {
        return returgoodYreimburse;
    }

    public void setReturgoodYreimburse(BigDecimal returgoodYreimburse) {
        this.returgoodYreimburse = returgoodYreimburse;
    }

    @Basic
    @Column(name = "returgood_reimburse")
    public BigDecimal getReturgoodReimburse() {
        return returgoodReimburse;
    }

    public void setReturgoodReimburse(BigDecimal returgoodReimburse) {
        this.returgoodReimburse = returgoodReimburse;
    }

    @Basic
    @Column(name = "returgood_warehouse")
    public String getReturgoodWarehouse() {
        return returgoodWarehouse;
    }

    public void setReturgoodWarehouse(String returgoodWarehouse) {
        this.returgoodWarehouse = returgoodWarehouse;
    }

    @Basic
    @Column(name = "returgood_state")
    public String getReturgoodState() {
        return returgoodState;
    }

    public void setReturgoodState(String returgoodState) {
        this.returgoodState = returgoodState;
    }

    @Basic
    @Column(name = "returgood_remark")
    public String getReturgoodRemark() {
        return returgoodRemark;
    }

    public void setReturgoodRemark(String returgoodRemark) {
        this.returgoodRemark = returgoodRemark;
    }

    @Basic
    @Column(name = "returgood_pass")
    public String getReturgoodPass() {
        return returgoodPass;
    }

    public void setReturgoodPass(String returgoodPass) {
        this.returgoodPass = returgoodPass;
    }

    @Basic
    @Column(name = "returgood_people")
    public String getReturgoodPeople() {
        return returgoodPeople;
    }

    public void setReturgoodPeople(String returgoodPeople) {
        this.returgoodPeople = returgoodPeople;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Zreturnedgood that = (Zreturnedgood) o;
        return returgoodId == that.returgoodId &&
                Objects.equals(orderId, that.orderId) &&
                Objects.equals(clientId, that.clientId) &&
                Objects.equals(returgoodNo, that.returgoodNo) &&
                Objects.equals(returgoodTime, that.returgoodTime) &&
                Objects.equals(returgoodYreimburse, that.returgoodYreimburse) &&
                Objects.equals(returgoodReimburse, that.returgoodReimburse) &&
                Objects.equals(returgoodWarehouse, that.returgoodWarehouse) &&
                Objects.equals(returgoodState, that.returgoodState) &&
                Objects.equals(returgoodPass, that.returgoodPass) &&
                Objects.equals(returgoodPeople, that.returgoodPeople);
    }

    @Override
    public int hashCode() {
        return Objects.hash(returgoodId, orderId, clientId, returgoodNo, returgoodTime, returgoodYreimburse, returgoodReimburse, returgoodWarehouse, returgoodState,  returgoodPass, returgoodPeople);
    }

    @OneToMany(mappedBy = "returgoodId")
    public List<Zreturnedgooddetail> getThxq() {
        return thxq;
    }

    public void setThxq(List<Zreturnedgooddetail> thxq) {
        this.thxq = thxq;
    }
}
